﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Touch2Like.Model;
using System.Net.Mail;
using System.Net;
using Touch2Like.SharedLibrary;

namespace Touch2Like.Web.Customer
{
    public partial class forgetpassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_Submit_Click(object sender, EventArgs e)
        {
            Touch2Like.DAL.UserDAL user = new Touch2Like.DAL.UserDAL();
            UserInfo info = user.GetUserByNameAndEmail(1, tb_Email.Text.Trim());

            if (info != null)
            {
                WebUtility.SendEmail(info.Email, info.UserName,1);
                lb_Msg.Text = "A letter has been sent to your email address.";
            }
            else
            {
                lb_Msg.Text = "Invalid email.";
                return;
            }
        }
    }
}